home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Guide Interactive 5
/
PC Guide Issue 5 (Future Publishing) (1995).iso
/
win95
/
shared.dir
/
00382_Script_DIALOG CALLING SCRIPTS
< prev
next >
Wrap
Text File
|
1995-06-01
|
14KB
|
541 lines
--== DIALOGS
-- The actual dialogs and scripts are in the dialog movie, which is opened as a MIAW.
-- The dialog scripts open the dialog movie and exit. Both movies are in process.
-- When a button is presses, the dialog movie puts the selected button's text (cancel, exit, etx.) into "the result" and calls the calling handler.
on dialogOpen d
global gDialogWindow, gLastAudio
set gLastAudio = "" -- try to make audio play again
sound stop 1
-- DIALOG FRAME DESCRIPTION
-- d1 Exit
-- d2 Reseller T.O.
-- d3 end auto demo
-- d4 restart
-- d5 restart from autodemo
if objectP(gDialogWindow) then
forget gDialogWindow
end if
set gDialogWindow to window "dw"
set the fileName of gDialogWindow to "Mdialogs.DIR"
set myWindowRect to rect(1,1,2,2)
set the rect of gDialogWindow to myWindowRect
set the windowType of gDialogWindow to 2
set the modal of gDialogWindow to true
set the titleVisible of gDialogWindow to false
set the visible of gDialogWindow to false
moveToBack gDialogWindow
--puppetSprite 48,1
--set the locH of sprite 48 to 322
--set the locV of sprite 48 to 237
--updateStage
open gDialogWindow
tell gDialogWindow
go to frame d
put dialogWidth() into w
put dialogHeight() into ht
end tell
set h to the StageLeft + 320 - (w/2)
set v to the stageTop + 240 - (ht/2)
set myWindowRect to rect(h, v, h + w-2, v + ht-2)
set the rect of gDialogWindow to myWindowRect
set the visible of gDialogWindow to true
moveToFront gDialogWindow
updateStage
--alert string(the loch of sprite 48)
end
on dialogClose
global gDialogWindow
if objectP(gDialogWindow) then
set the modal of gDialogWindow to false
set the visible of gDialogWindow to false
--set the locH of sprite 48 to -1000
puppetSprite 48,0
forget gDialogWindow
updateStage
if the movie = "M08CHBKG.DIR" and the frameLabel = "end" then
drawPaper
end if
end if
end
on timeOutResellerDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gAutoMode,gMainMovieName
if gDialogResult = "" then
-- set up dialog
put "timeOutResellerDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
set the timeoutLength to gDialogTimeout
set the timeOutScript to "goCloser"
if gAutoMode = true then
dialogOpen "d5"
else
dialogOpen "d5a"
end if
else
--
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "automatic" then
-- stay in topic but in interactive mode
set gAutoMode to 1
set gTeaserMode to 0
clearTimeout
if the movie = gMainMovieName then
clearMenuButtons
selectSection "quick tour"
end if
else if r = "interactive" then
set gAutoMode to 0
set gTeaserMode to 0
resetResellerTimeout
else if r = "restart" then
goCloser
exit
end if
end if
end
on exitDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
global gAutoMode,gResellerVersion
global gLastScreen
-- save place
--put the frame & "," & the movie into gLastScreen
if gDialogResult = "" then
-- set up dialog
put "exitDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
--set the timeoutLength to gDialogTimeout
--set the timeOutScript to "goCloser"
dialogOpen "d1"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "exit" then
if gResellerVersion = FALSE then
scanDialog
else
goCloser
end if
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end
on scanDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout,gScanExitFlag
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
if gDialogResult = "" then
-- set up dialog
put "scanDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
--set the timeoutLength to gDialogTimeout
--set the timeOutScript to "goCloser"
dialogOpen "d6"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "exit" then
goCloser
exit
else if r = "scan" then
set gScanExitFlag = 3
goScan
exit
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end
on deleteFilesDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
if gDialogResult = "" then
-- set up dialog
put "deleteFilesDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
--set the timeoutLength to gDialogTimeout
--set the timeOutScript to "goCloser"
dialogOpen "d2"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "exit" then
doQuit
exit
else if r = "delete" then
--doDeleteFiles
deleteFilesDialog2
exit
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end
on deleteFilesDialog2
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
if gDialogResult = "" then
-- set up dialog
put "deleteFilesDialog2" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
--set the timeoutLength to gDialogTimeout
--set the timeOutScript to "goCloser"
dialogOpen "d7"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 5
if r = "exit" then
doQuit
exit
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
deleteFilesDialog
end if
end
on restartDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
global gResellerVersion
timeOutResellerDialog
exit
if gDialogResult = "" then
if gResellerVersion = TRUE then
timeOutResellerDialog
exit
end if
-- set up dialog
put "restartDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
set the timeoutLength to gDialogTimeout
set the timeOutScript to "goCloser"
dialogOpen "d4"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "exit" then
goCloser
exit
else if r = "restart" then
goRestart
exit
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end
on AutoDecisionDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
global gResellerVersion,gMainMovieName
global gAutoMode, gTeaserMode
if gDialogResult = "" then
-- set up dialog
put "AutoDecisionDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
if gResellerVersion = TRUE then
set the timeoutLength to gDialogTimeOut
set the timeOutScript to "chooseTeaserDemo"
end if
dialogOpen "d5"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
if r = "interactive" then
-- stay in topic but in interactive mode
set gAutoMode to 0
set gTeaserMode to 0
if gResellerVersion = TRUE then
resetResellerTimeout
else
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
exit
else if r = "restart" then
goRestart
exit
else
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end if
end
on timeOutDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
if gDialogResult = "" then
-- set up dialog
put "timeOutDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
set the timeoutLength to gDialogTimeout
set the timeOutScript to "goCloser"
dialogOpen "d5"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "exit" then
goCloser
exit
else if r = "restart" then
goRestart
exit
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end
on endAutoDemoDialog
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
global gResellerVersion
if gDialogResult = "" then
-- set up dialog
put "endAutoDemoDialog" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
if gResellerVersion = true then
set the timeoutLength to gDialogTimeout
set the timeOutScript to "goCloser"
end if
dialogOpen "d3"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "exit" then
exitDialog
exit
else if r = "restart" then
goRestart
exit
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end
on endAutoDemoDialogReseller
global gIntroTimeOut,gInteractiveTimeout,gOEMTimeout,gResellerTimeout,gDialogTimeout
global gDialogWindow,gDialogResult,gDialogCallback,gLastTimeoutScript,gLastTimeoutLength
global gResellerVersion
if gDialogResult = "" then
-- set up dialog
put "endAutoDemoDialogReseller" into gDialogCallback
put "" into gDialogResult
set gLastTimeoutScript to the timeOutScript
set gLastTimeoutLength to the timeoutLength
set the timeOutScript to ""
if gResellerVersion = true then
set the timeoutLength to gDialogTimeout
set the timeOutScript to "goCloser"
end if
dialogOpen "d9"
else
-- check result and take action
dialogClose
set r = gDialogResult
set gDialogResult = ""
set the timeOutScript to ""
set the timeoutLength to 0
if r = "menu" then
set gAutoMode to 0
set gTeaserMode to 0
resetResellerTimeout
goMenu
exit
else if r = "restart" then
goRestart
exit
end if
-- if cancel...
set the timeOutScript to gLastTimeoutScript
set the timeoutLength to gLastTimeoutLength
end if
end